<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>IVF-HNSW: ivfhnsw::IndexIVF_HNSW_Grouping Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">IVF-HNSW
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>ivfhnsw</b></li><li class="navelem"><a class="el" href="structivfhnsw_1_1IndexIVF__HNSW__Grouping.html">IndexIVF_HNSW_Grouping</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="structivfhnsw_1_1IndexIVF__HNSW__Grouping-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">ivfhnsw::IndexIVF_HNSW_Grouping Struct Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="dynheader">
Inheritance diagram for ivfhnsw::IndexIVF_HNSW_Grouping:</div>
<div class="dyncontent">
 <div class="center">
  <img src="structivfhnsw_1_1IndexIVF__HNSW__Grouping.png" usemap="#ivfhnsw::IndexIVF_HNSW_Grouping_map" alt=""/>
  <map id="ivfhnsw::IndexIVF_HNSW_Grouping_map" name="ivfhnsw::IndexIVF_HNSW_Grouping_map">
<area href="structivfhnsw_1_1IndexIVF__HNSW.html" alt="ivfhnsw::IndexIVF_HNSW" shape="rect" coords="0,0,214,24"/>
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a6fb0707ecef8bfc40a1ea2e6367bf481"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6fb0707ecef8bfc40a1ea2e6367bf481"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>IndexIVF_HNSW_Grouping</b> (size_t dim, size_t ncentroids, size_t bytes_per_code, size_t nbits_per_idx, size_t nsubcentroids)</td></tr>
<tr class="separator:a6fb0707ecef8bfc40a1ea2e6367bf481"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0d1842d6849fbab97bb2daf022f4a940"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structivfhnsw_1_1IndexIVF__HNSW__Grouping.html#a0d1842d6849fbab97bb2daf022f4a940">add_group</a> (size_t group_idx, size_t group_size, const float *x, const <a class="el" href="structivfhnsw_1_1IndexIVF__HNSW.html#a7c6fb7b945eba6a48d28ea36db5809fc">idx_t</a> *<a class="el" href="structivfhnsw_1_1IndexIVF__HNSW.html#ad40193d01d98d4a55847638581d610bb">ids</a>)</td></tr>
<tr class="separator:a0d1842d6849fbab97bb2daf022f4a940"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a399996617a43e549ee886dcd57424b45"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structivfhnsw_1_1IndexIVF__HNSW__Grouping.html#a399996617a43e549ee886dcd57424b45">search</a> (size_t k, const float *x, float *distances, long *labels)</td></tr>
<tr class="separator:a399996617a43e549ee886dcd57424b45"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a48a6813044ff0012b125297e272544ba"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a48a6813044ff0012b125297e272544ba"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structivfhnsw_1_1IndexIVF__HNSW__Grouping.html#a48a6813044ff0012b125297e272544ba">write</a> (const char *path_index)</td></tr>
<tr class="memdesc:a48a6813044ff0012b125297e272544ba"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write index to the path. <br/></td></tr>
<tr class="separator:a48a6813044ff0012b125297e272544ba"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8d41b41e32f6c6d93568d2accbd4e466"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8d41b41e32f6c6d93568d2accbd4e466"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structivfhnsw_1_1IndexIVF__HNSW__Grouping.html#a8d41b41e32f6c6d93568d2accbd4e466">read</a> (const char *path_index)</td></tr>
<tr class="memdesc:a8d41b41e32f6c6d93568d2accbd4e466"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read index from the path. <br/></td></tr>
<tr class="separator:a8d41b41e32f6c6d93568d2accbd4e466"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adebace156120602539d25e534887e570"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structivfhnsw_1_1IndexIVF__HNSW__Grouping.html#adebace156120602539d25e534887e570">train_pq</a> (size_t n, const float *x)</td></tr>
<tr class="separator:adebace156120602539d25e534887e570"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a298361bf2adc2f2357c5b417e80d1611"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a298361bf2adc2f2357c5b417e80d1611"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structivfhnsw_1_1IndexIVF__HNSW__Grouping.html#a298361bf2adc2f2357c5b417e80d1611">compute_inter_centroid_dists</a> ()</td></tr>
<tr class="memdesc:a298361bf2adc2f2357c5b417e80d1611"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compute distances between the group centroid and its &lt;subc&gt; nearest neighbors in the HNSW graph. <br/></td></tr>
<tr class="separator:a298361bf2adc2f2357c5b417e80d1611"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_structivfhnsw_1_1IndexIVF__HNSW"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_structivfhnsw_1_1IndexIVF__HNSW')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="structivfhnsw_1_1IndexIVF__HNSW.html">ivfhnsw::IndexIVF_HNSW</a></td></tr>
<tr class="memitem:adefe5a46b63461f111c92139c3cdafd6 inherit pub_methods_structivfhnsw_1_1IndexIVF__HNSW"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="adefe5a46b63461f111c92139c3cdafd6"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>IndexIVF_HNSW</b> (size_t dim, size_t ncentroids, size_t bytes_per_code, size_t nbits_per_idx, size_t max_group_size=65536)</td></tr>
<tr class="separator:adefe5a46b63461f111c92139c3cdafd6 inherit pub_methods_structivfhnsw_1_1IndexIVF__HNSW"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad8520f5a9a46864c038b74116b6d0ba8 inherit pub_methods_structivfhnsw_1_1IndexIVF__HNSW"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structivfhnsw_1_1IndexIVF__HNSW.html#ad8520f5a9a46864c038b74116b6d0ba8">build_quantizer</a> (const char *path_data, const char *path_info, const char *path_edges, size_t M=16, size_t efConstruction=500)</td></tr>
<tr class="separator:ad8520f5a9a46864c038b74116b6d0ba8 inherit pub_methods_structivfhnsw_1_1IndexIVF__HNSW"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a16438e89ea04032d43b7fea4854fdb09 inherit pub_methods_structivfhnsw_1_1IndexIVF__HNSW"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structivfhnsw_1_1IndexIVF__HNSW.html#a16438e89ea04032d43b7fea4854fdb09">assign</a> (size_t n, const float *x, <a class="el" href="structivfhnsw_1_1IndexIVF__HNSW.html#a7c6fb7b945eba6a48d28ea36db5809fc">idx_t</a> *labels, size_t k=1)</td></tr>
<tr class="separator:a16438e89ea04032d43b7fea4854fdb09 inherit pub_methods_structivfhnsw_1_1IndexIVF__HNSW"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a750c9093b1fa5adf7d80a9ca6aec5de4 inherit pub_methods_structivfhnsw_1_1IndexIVF__HNSW"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structivfhnsw_1_1IndexIVF__HNSW.html#a750c9093b1fa5adf7d80a9ca6aec5de4">add_batch</a> (size_t n, const float *x, const <a class="el" href="structivfhnsw_1_1IndexIVF__HNSW.html#a7c6fb7b945eba6a48d28ea36db5809fc">idx_t</a> *xids, const <a class="el" href="structivfhnsw_1_1IndexIVF__HNSW.html#a7c6fb7b945eba6a48d28ea36db5809fc">idx_t</a> *precomputed_idx=nullptr)</td></tr>
<tr class="separator:a750c9093b1fa5adf7d80a9ca6aec5de4 inherit pub_methods_structivfhnsw_1_1IndexIVF__HNSW"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac5a4b723f412d1a54ddee29db4d6a594 inherit pub_methods_structivfhnsw_1_1IndexIVF__HNSW"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac5a4b723f412d1a54ddee29db4d6a594"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structivfhnsw_1_1IndexIVF__HNSW.html#ac5a4b723f412d1a54ddee29db4d6a594">compute_centroid_norms</a> ()</td></tr>
<tr class="memdesc:ac5a4b723f412d1a54ddee29db4d6a594 inherit pub_methods_structivfhnsw_1_1IndexIVF__HNSW"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compute norms of the HNSW vertices. <br/></td></tr>
<tr class="separator:ac5a4b723f412d1a54ddee29db4d6a594 inherit pub_methods_structivfhnsw_1_1IndexIVF__HNSW"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a283b84e2daa00165d08e2ed8a1c775ac inherit pub_methods_structivfhnsw_1_1IndexIVF__HNSW"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a283b84e2daa00165d08e2ed8a1c775ac"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structivfhnsw_1_1IndexIVF__HNSW.html#a283b84e2daa00165d08e2ed8a1c775ac">rotate_quantizer</a> ()</td></tr>
<tr class="memdesc:a283b84e2daa00165d08e2ed8a1c775ac inherit pub_methods_structivfhnsw_1_1IndexIVF__HNSW"><td class="mdescLeft">&#160;</td><td class="mdescRight">For correct search using OPQ encoding rotate points in the coarse quantizer. <br/></td></tr>
<tr class="separator:a283b84e2daa00165d08e2ed8a1c775ac inherit pub_methods_structivfhnsw_1_1IndexIVF__HNSW"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:ad44707e8f2a79907872e152c7c7bedc0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad44707e8f2a79907872e152c7c7bedc0"></a>
size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structivfhnsw_1_1IndexIVF__HNSW__Grouping.html#ad44707e8f2a79907872e152c7c7bedc0">nsubc</a></td></tr>
<tr class="memdesc:ad44707e8f2a79907872e152c7c7bedc0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Number of sub-centroids per group. <br/></td></tr>
<tr class="separator:ad44707e8f2a79907872e152c7c7bedc0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1a5ca7b0618e58131bf1bebd76bc0547"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1a5ca7b0618e58131bf1bebd76bc0547"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structivfhnsw_1_1IndexIVF__HNSW__Grouping.html#a1a5ca7b0618e58131bf1bebd76bc0547">do_pruning</a></td></tr>
<tr class="memdesc:a1a5ca7b0618e58131bf1bebd76bc0547"><td class="mdescLeft">&#160;</td><td class="mdescRight">Turn on/off pruning. <br/></td></tr>
<tr class="separator:a1a5ca7b0618e58131bf1bebd76bc0547"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3b0be75945927e8c187b4fda4b3abd12"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3b0be75945927e8c187b4fda4b3abd12"></a>
std::vector&lt; std::vector&lt; <a class="el" href="structivfhnsw_1_1IndexIVF__HNSW.html#a7c6fb7b945eba6a48d28ea36db5809fc">idx_t</a> &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structivfhnsw_1_1IndexIVF__HNSW__Grouping.html#a3b0be75945927e8c187b4fda4b3abd12">nn_centroid_idxs</a></td></tr>
<tr class="memdesc:a3b0be75945927e8c187b4fda4b3abd12"><td class="mdescLeft">&#160;</td><td class="mdescRight">Indices of the &lt;nsubc&gt; nearest centroids for each centroid. <br/></td></tr>
<tr class="separator:a3b0be75945927e8c187b4fda4b3abd12"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a11c3fd0ab12ee9be4aec1bf44b8a5615"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a11c3fd0ab12ee9be4aec1bf44b8a5615"></a>
std::vector&lt; std::vector&lt; <a class="el" href="structivfhnsw_1_1IndexIVF__HNSW.html#a7c6fb7b945eba6a48d28ea36db5809fc">idx_t</a> &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structivfhnsw_1_1IndexIVF__HNSW__Grouping.html#a11c3fd0ab12ee9be4aec1bf44b8a5615">subgroup_sizes</a></td></tr>
<tr class="memdesc:a11c3fd0ab12ee9be4aec1bf44b8a5615"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sizes of sub-groups for each group. <br/></td></tr>
<tr class="separator:a11c3fd0ab12ee9be4aec1bf44b8a5615"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a54c5fa227e3c10eaec992e3af39b6e06"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a54c5fa227e3c10eaec992e3af39b6e06"></a>
std::vector&lt; float &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structivfhnsw_1_1IndexIVF__HNSW__Grouping.html#a54c5fa227e3c10eaec992e3af39b6e06">alphas</a></td></tr>
<tr class="memdesc:a54c5fa227e3c10eaec992e3af39b6e06"><td class="mdescLeft">&#160;</td><td class="mdescRight">Coefficients that determine the location of sub-centroids. <br/></td></tr>
<tr class="separator:a54c5fa227e3c10eaec992e3af39b6e06"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td colspan="2" onclick="javascript:toggleInherit('pub_attribs_structivfhnsw_1_1IndexIVF__HNSW')"><img src="closed.png" alt="-"/>&#160;Public Attributes inherited from <a class="el" href="structivfhnsw_1_1IndexIVF__HNSW.html">ivfhnsw::IndexIVF_HNSW</a></td></tr>
<tr class="memitem:a609cc185fcb377f9d8bb5a4e5e7d2c4f inherit pub_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a609cc185fcb377f9d8bb5a4e5e7d2c4f"></a>
size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structivfhnsw_1_1IndexIVF__HNSW.html#a609cc185fcb377f9d8bb5a4e5e7d2c4f">d</a></td></tr>
<tr class="memdesc:a609cc185fcb377f9d8bb5a4e5e7d2c4f inherit pub_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="mdescLeft">&#160;</td><td class="mdescRight">Vector dimension. <br/></td></tr>
<tr class="separator:a609cc185fcb377f9d8bb5a4e5e7d2c4f inherit pub_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a530ea15e63fa6a6f86cf5feb511c73c3 inherit pub_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a530ea15e63fa6a6f86cf5feb511c73c3"></a>
size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structivfhnsw_1_1IndexIVF__HNSW.html#a530ea15e63fa6a6f86cf5feb511c73c3">nc</a></td></tr>
<tr class="memdesc:a530ea15e63fa6a6f86cf5feb511c73c3 inherit pub_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="mdescLeft">&#160;</td><td class="mdescRight">Number of centroids. <br/></td></tr>
<tr class="separator:a530ea15e63fa6a6f86cf5feb511c73c3 inherit pub_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5dabe1116836baf19e25bc1ea89c565c inherit pub_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5dabe1116836baf19e25bc1ea89c565c"></a>
size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structivfhnsw_1_1IndexIVF__HNSW.html#a5dabe1116836baf19e25bc1ea89c565c">code_size</a></td></tr>
<tr class="memdesc:a5dabe1116836baf19e25bc1ea89c565c inherit pub_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="mdescLeft">&#160;</td><td class="mdescRight">Code size per vector in bytes. <br/></td></tr>
<tr class="separator:a5dabe1116836baf19e25bc1ea89c565c inherit pub_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac31af605b0da2dd25cd0dbf51f8a4802 inherit pub_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac31af605b0da2dd25cd0dbf51f8a4802"></a>
hnswlib::HierarchicalNSW *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structivfhnsw_1_1IndexIVF__HNSW.html#ac31af605b0da2dd25cd0dbf51f8a4802">quantizer</a></td></tr>
<tr class="memdesc:ac31af605b0da2dd25cd0dbf51f8a4802 inherit pub_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="mdescLeft">&#160;</td><td class="mdescRight">Quantizer that maps vectors to inverted lists (HNSW [Y.Malkov]) <br/></td></tr>
<tr class="separator:ac31af605b0da2dd25cd0dbf51f8a4802 inherit pub_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaf630999dcdc300137ffe8f1e93dde21 inherit pub_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aaf630999dcdc300137ffe8f1e93dde21"></a>
faiss::ProductQuantizer *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structivfhnsw_1_1IndexIVF__HNSW.html#aaf630999dcdc300137ffe8f1e93dde21">pq</a></td></tr>
<tr class="memdesc:aaf630999dcdc300137ffe8f1e93dde21 inherit pub_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="mdescLeft">&#160;</td><td class="mdescRight">Produces the residual codes. <br/></td></tr>
<tr class="separator:aaf630999dcdc300137ffe8f1e93dde21 inherit pub_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acff5d189392af6d63db5d782df89f79b inherit pub_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="acff5d189392af6d63db5d782df89f79b"></a>
faiss::ProductQuantizer *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structivfhnsw_1_1IndexIVF__HNSW.html#acff5d189392af6d63db5d782df89f79b">norm_pq</a></td></tr>
<tr class="memdesc:acff5d189392af6d63db5d782df89f79b inherit pub_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="mdescLeft">&#160;</td><td class="mdescRight">Produces the norm codes of reconstructed base vectors. <br/></td></tr>
<tr class="separator:acff5d189392af6d63db5d782df89f79b inherit pub_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a45f738ebf5e73b87a11983911d54dd8b inherit pub_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a45f738ebf5e73b87a11983911d54dd8b"></a>
faiss::LinearTransform *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structivfhnsw_1_1IndexIVF__HNSW.html#a45f738ebf5e73b87a11983911d54dd8b">opq_matrix</a></td></tr>
<tr class="memdesc:a45f738ebf5e73b87a11983911d54dd8b inherit pub_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="mdescLeft">&#160;</td><td class="mdescRight">Rotation matrix for OPQ encoding. <br/></td></tr>
<tr class="separator:a45f738ebf5e73b87a11983911d54dd8b inherit pub_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9660b70f02a7b529ef7e997a685e1f5e inherit pub_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9660b70f02a7b529ef7e997a685e1f5e"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structivfhnsw_1_1IndexIVF__HNSW.html#a9660b70f02a7b529ef7e997a685e1f5e">do_opq</a></td></tr>
<tr class="memdesc:a9660b70f02a7b529ef7e997a685e1f5e inherit pub_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="mdescLeft">&#160;</td><td class="mdescRight">Turn on/off OPQ encoding. <br/></td></tr>
<tr class="separator:a9660b70f02a7b529ef7e997a685e1f5e inherit pub_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0be6e0ce24b188401271104857283d48 inherit pub_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0be6e0ce24b188401271104857283d48"></a>
size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structivfhnsw_1_1IndexIVF__HNSW.html#a0be6e0ce24b188401271104857283d48">nprobe</a></td></tr>
<tr class="memdesc:a0be6e0ce24b188401271104857283d48 inherit pub_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="mdescLeft">&#160;</td><td class="mdescRight">Number of probes at search time. <br/></td></tr>
<tr class="separator:a0be6e0ce24b188401271104857283d48 inherit pub_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a23f33c7f1b7707580f61c1e69f1373e1 inherit pub_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a23f33c7f1b7707580f61c1e69f1373e1"></a>
size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structivfhnsw_1_1IndexIVF__HNSW.html#a23f33c7f1b7707580f61c1e69f1373e1">max_codes</a></td></tr>
<tr class="memdesc:a23f33c7f1b7707580f61c1e69f1373e1 inherit pub_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="mdescLeft">&#160;</td><td class="mdescRight">Max number of codes to visit to do a query. <br/></td></tr>
<tr class="separator:a23f33c7f1b7707580f61c1e69f1373e1 inherit pub_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad40193d01d98d4a55847638581d610bb inherit pub_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad40193d01d98d4a55847638581d610bb"></a>
std::vector&lt; std::vector&lt; <a class="el" href="structivfhnsw_1_1IndexIVF__HNSW.html#a7c6fb7b945eba6a48d28ea36db5809fc">idx_t</a> &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structivfhnsw_1_1IndexIVF__HNSW.html#ad40193d01d98d4a55847638581d610bb">ids</a></td></tr>
<tr class="memdesc:ad40193d01d98d4a55847638581d610bb inherit pub_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="mdescLeft">&#160;</td><td class="mdescRight">Inverted lists for indexes. <br/></td></tr>
<tr class="separator:ad40193d01d98d4a55847638581d610bb inherit pub_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad2ca994b4a3bf65a3fe7d1cf863a0da1 inherit pub_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad2ca994b4a3bf65a3fe7d1cf863a0da1"></a>
std::vector&lt; std::vector<br class="typebreak"/>
&lt; uint8_t &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structivfhnsw_1_1IndexIVF__HNSW.html#ad2ca994b4a3bf65a3fe7d1cf863a0da1">codes</a></td></tr>
<tr class="memdesc:ad2ca994b4a3bf65a3fe7d1cf863a0da1 inherit pub_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="mdescLeft">&#160;</td><td class="mdescRight">PQ codes of residuals. <br/></td></tr>
<tr class="separator:ad2ca994b4a3bf65a3fe7d1cf863a0da1 inherit pub_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a569a6cca33552f450f253f4d667b6bc4 inherit pub_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a569a6cca33552f450f253f4d667b6bc4"></a>
std::vector&lt; std::vector<br class="typebreak"/>
&lt; uint8_t &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structivfhnsw_1_1IndexIVF__HNSW.html#a569a6cca33552f450f253f4d667b6bc4">norm_codes</a></td></tr>
<tr class="memdesc:a569a6cca33552f450f253f4d667b6bc4 inherit pub_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="mdescLeft">&#160;</td><td class="mdescRight">PQ codes of norms of reconstructed base vectors. <br/></td></tr>
<tr class="separator:a569a6cca33552f450f253f4d667b6bc4 inherit pub_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:a93e52af13d1df43ad5c96a897317af72"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a93e52af13d1df43ad5c96a897317af72"></a>
std::vector&lt; float &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structivfhnsw_1_1IndexIVF__HNSW__Grouping.html#a93e52af13d1df43ad5c96a897317af72">query_centroid_dists</a></td></tr>
<tr class="memdesc:a93e52af13d1df43ad5c96a897317af72"><td class="mdescLeft">&#160;</td><td class="mdescRight">Distances to the coarse centroids. Used for distance computation between a query and base points. <br/></td></tr>
<tr class="separator:a93e52af13d1df43ad5c96a897317af72"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad5484dcaf72dcbaf324ac428b06327b0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad5484dcaf72dcbaf324ac428b06327b0"></a>
std::vector&lt; std::vector&lt; float &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structivfhnsw_1_1IndexIVF__HNSW__Grouping.html#ad5484dcaf72dcbaf324ac428b06327b0">inter_centroid_dists</a></td></tr>
<tr class="memdesc:ad5484dcaf72dcbaf324ac428b06327b0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Distances between coarse centroids and their sub-centroids. <br/></td></tr>
<tr class="separator:ad5484dcaf72dcbaf324ac428b06327b0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pro_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td colspan="2" onclick="javascript:toggleInherit('pro_attribs_structivfhnsw_1_1IndexIVF__HNSW')"><img src="closed.png" alt="-"/>&#160;Protected Attributes inherited from <a class="el" href="structivfhnsw_1_1IndexIVF__HNSW.html">ivfhnsw::IndexIVF_HNSW</a></td></tr>
<tr class="memitem:a16ef4d800329fa8a3b7377e21af659f3 inherit pro_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a16ef4d800329fa8a3b7377e21af659f3"></a>
std::vector&lt; float &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structivfhnsw_1_1IndexIVF__HNSW.html#a16ef4d800329fa8a3b7377e21af659f3">norms</a></td></tr>
<tr class="memdesc:a16ef4d800329fa8a3b7377e21af659f3 inherit pro_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="mdescLeft">&#160;</td><td class="mdescRight">L2 square norms of reconstructed base vectors. <br/></td></tr>
<tr class="separator:a16ef4d800329fa8a3b7377e21af659f3 inherit pro_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a10dd2523ee2de0500e88c256e276f01b inherit pro_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a10dd2523ee2de0500e88c256e276f01b"></a>
std::vector&lt; float &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structivfhnsw_1_1IndexIVF__HNSW.html#a10dd2523ee2de0500e88c256e276f01b">centroid_norms</a></td></tr>
<tr class="memdesc:a10dd2523ee2de0500e88c256e276f01b inherit pro_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="mdescLeft">&#160;</td><td class="mdescRight">L2 square norms of coarse centroids. <br/></td></tr>
<tr class="separator:a10dd2523ee2de0500e88c256e276f01b inherit pro_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7143a3df1464f0af998ff7cfdf20b19c inherit pro_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7143a3df1464f0af998ff7cfdf20b19c"></a>
std::vector&lt; float &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structivfhnsw_1_1IndexIVF__HNSW.html#a7143a3df1464f0af998ff7cfdf20b19c">precomputed_table</a></td></tr>
<tr class="memdesc:a7143a3df1464f0af998ff7cfdf20b19c inherit pro_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="mdescLeft">&#160;</td><td class="mdescRight">Size pq.M * pq.ksub. <br/></td></tr>
<tr class="separator:a7143a3df1464f0af998ff7cfdf20b19c inherit pro_attribs_structivfhnsw_1_1IndexIVF__HNSW"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a>
Additional Inherited Members</h2></td></tr>
<tr class="inherit_header pub_types_structivfhnsw_1_1IndexIVF__HNSW"><td colspan="2" onclick="javascript:toggleInherit('pub_types_structivfhnsw_1_1IndexIVF__HNSW')"><img src="closed.png" alt="-"/>&#160;Public Types inherited from <a class="el" href="structivfhnsw_1_1IndexIVF__HNSW.html">ivfhnsw::IndexIVF_HNSW</a></td></tr>
<tr class="memitem:a7c6fb7b945eba6a48d28ea36db5809fc inherit pub_types_structivfhnsw_1_1IndexIVF__HNSW"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7c6fb7b945eba6a48d28ea36db5809fc"></a>
typedef uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structivfhnsw_1_1IndexIVF__HNSW.html#a7c6fb7b945eba6a48d28ea36db5809fc">idx_t</a></td></tr>
<tr class="memdesc:a7c6fb7b945eba6a48d28ea36db5809fc inherit pub_types_structivfhnsw_1_1IndexIVF__HNSW"><td class="mdescLeft">&#160;</td><td class="mdescRight">all indices are this type <br/></td></tr>
<tr class="separator:a7c6fb7b945eba6a48d28ea36db5809fc inherit pub_types_structivfhnsw_1_1IndexIVF__HNSW"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pro_methods_structivfhnsw_1_1IndexIVF__HNSW"><td colspan="2" onclick="javascript:toggleInherit('pro_methods_structivfhnsw_1_1IndexIVF__HNSW')"><img src="closed.png" alt="-"/>&#160;Protected Member Functions inherited from <a class="el" href="structivfhnsw_1_1IndexIVF__HNSW.html">ivfhnsw::IndexIVF_HNSW</a></td></tr>
<tr class="memitem:abd20f0d5f3a516996267961a578cd584 inherit pro_methods_structivfhnsw_1_1IndexIVF__HNSW"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abd20f0d5f3a516996267961a578cd584"></a>
float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structivfhnsw_1_1IndexIVF__HNSW.html#abd20f0d5f3a516996267961a578cd584">pq_L2sqr</a> (const uint8_t *code)</td></tr>
<tr class="memdesc:abd20f0d5f3a516996267961a578cd584 inherit pro_methods_structivfhnsw_1_1IndexIVF__HNSW"><td class="mdescLeft">&#160;</td><td class="mdescRight">L2 sqr distance function for PQ codes. <br/></td></tr>
<tr class="separator:abd20f0d5f3a516996267961a578cd584 inherit pro_methods_structivfhnsw_1_1IndexIVF__HNSW"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a0d1842d6849fbab97bb2daf022f4a940"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ivfhnsw::IndexIVF_HNSW_Grouping::add_group </td>
          <td>(</td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>group_idx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>group_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const float *&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structivfhnsw_1_1IndexIVF__HNSW.html#a7c6fb7b945eba6a48d28ea36db5809fc">idx_t</a> *&#160;</td>
          <td class="paramname"><em>ids</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Add &lt;group_size&gt; vectors of dimension &lt;d&gt; from the &lt;group_idx&gt;-th group to the index.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">group_idx</td><td>index of the group </td></tr>
    <tr><td class="paramname">group_size</td><td>number of base vectors in the group </td></tr>
    <tr><td class="paramname">x</td><td>base vectors to add (size: group_size * d) </td></tr>
    <tr><td class="paramname">ids</td><td>ids to store for the vectors (size: groups_size) </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a399996617a43e549ee886dcd57424b45"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void ivfhnsw::IndexIVF_HNSW_Grouping::search </td>
          <td>(</td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>k</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const float *&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float *&#160;</td>
          <td class="paramname"><em>distances</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long *&#160;</td>
          <td class="paramname"><em>labels</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Search procedure</p>
<p>During the IVF-HNSW-PQ + Grouping search we compute</p>
<p>d = || x - y_S - y_R ||^2</p>
<p>where x is the query vector, y_S the coarse sub-centroid, y_R the refined PQ centroid. The expression can be decomposed as:</p>
<p>d = (1 - α) * (|| x - y_C ||^2 - || y_C ||^2) + α * (|| x - y_N ||^2 - || y_N ||^2) + || y_S + y_R ||^2 - 2 * (x|y_R) </p>
<hr/>
<p> term 1 term 2 term 3 term 4</p>
<p>We use the following decomposition:</p>
<ul>
<li>term 1 is the distance to the coarse centroid, that is computed during the 1st stage search in the HNSW graph, minus the norm of the coarse centroid.</li>
<li>term 2 is the distance to y_N one of the &lt;subc&gt; nearest centroids, that is used for the sub-centroid computation, minus the norm of this centroid.</li>
<li>term 3 is the L2 norm of the reconstructed base point, that is computed at construction time, quantized using separately trained product quantizer for such norms and stored along with the residual PQ codes.</li>
<li>term 4 is the classical non-residual distance table.</li>
</ul>
<p>Norms of centroids are precomputed and saved without compression, as their memory consumption is negligible. If it is necessary, the norms can be added to the term 3 and compressed to byte together. We do not think that it will lead to considerable decrease in accuracy.</p>
<p>Since y_R defined by a product quantizer, it is split across sub-vectors and stored separately for each sub-vector. </p>

<p>Reimplemented from <a class="el" href="structivfhnsw_1_1IndexIVF__HNSW.html#a276c84ab9e7117ea021a2ff4e11f4a99">ivfhnsw::IndexIVF_HNSW</a>.</p>

</div>
</div>
<a class="anchor" id="adebace156120602539d25e534887e570"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void ivfhnsw::IndexIVF_HNSW_Grouping::train_pq </td>
          <td>(</td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>n</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const float *&#160;</td>
          <td class="paramname"><em>x</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Train product quantizers</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">n</td><td>number of training vectors of dimension d </td></tr>
    <tr><td class="paramname">x</td><td>learn vectors, size n * d </td></tr>
  </table>
  </dd>
</dl>

<p>Reimplemented from <a class="el" href="structivfhnsw_1_1IndexIVF__HNSW.html#a6774efa5e477a077ec9cf4a6d1f52361">ivfhnsw::IndexIVF_HNSW</a>.</p>

</div>
</div>
<hr/>The documentation for this struct was generated from the following files:<ul>
<li><a class="el" href="IndexIVF__HNSW__Grouping_8h_source.html">IndexIVF_HNSW_Grouping.h</a></li>
<li>IndexIVF_HNSW_Grouping.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Feb 8 2018 16:55:50 for IVF-HNSW by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.6
</small></address>
</body>
</html>
